#!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
__author__ = "Administrator"
__name__="multiprocessPID_PPID"
__date__="2016/8/1"
__time__="14:58"
"""
# 多进程的另一种写法
from multiprocessing import Process
import os
import time

def info(titile):
    print(titile)
    print 'module name:',__name__
    if hasattr(os,'getppid'):
        print 'parent process:',os.getppid()
    time.sleep(15)
    print 'process id:',os.getppid()

def f(name):
    info('functiont f')
    print 'hello',name

if __name__ == '__main__':
    info('main line')
    print '---------------------'
    p = Process(target=f,args=('bob',))
    p.start()
    p.join()


# linux上执行，ps -ef 查看